<?php 
// Library files
include '../includes/cPlayer.php';
include '../includes/cMember.php';
include '../includes/cDatabase.php';
include '../includes/variables.php';
include '../includes/cGame.php';
include '../includes/cDates.php';
include '../includes/cPage.php';

define("TD_NAME", "<td width='100' align='center'>");

$cPage = new page("Team Of The Month: Instructions");
echo $cPage->getTitle();
echo $cPage->pageStringStart();
echo $cPage->contentStringStart();

$cDates = new dates();

$endMonth = $cDates->getEndMonth();
if ($endMonth < $cDates->getStartMonth())
{
	// It's next year
	$endMonth = $cDates->getEndMonth()+12;
}
echo "<BR>The table below shows which weeks and dates the team of the month competition is relevant for.";
echo "<BR><BR>Teams score points between the two dates shown for each particular month. The team with the most points for that";
echo "<BR>period wins the prize money shown.";
echo "<BR><BR>";
echo "<table>";
echo "<tr>";
echo "<th>Month</th><th>From</th><th>(Week)</th><th>To</th><th>(Week)</th><th>Prize Money</th>";
echo "</tr>";

for ($month = $cDates->getStartMonth(); $month <= $endMonth; $month++)
{
	if ($month > 12)
	{
		// It's next year
		$monthName = $cDates->getMonthName($month - 12);
	}
	else
	{
		$monthName = $cDates->getMonthName($month);
	}
	
	echo "<tr>";

	echo TD_NAME.$monthName."</td>";
	echo TD_NAME.date("d-m-Y",$cDates->getStartDateForMonth($month))."</td>";
	echo TD_NAME.$cDates->getWeekFromDate($cDates->getStartDateForMonth($month), 'start')."</td>";
	echo TD_NAME.date("d-m-Y",$cDates->getEndDateForMonth($month))."</td>";
	echo TD_NAME.$cDates->getWeekFromDate($cDates->getEndDateForMonth($month), 'end')."</td>";
	echo TD_NAME."£".TEAM_OF_THE_MONTH."</td>";
	echo "</tr>";
}

echo "</table>";

echo $cPage->getContentStringEnd();
echo $cPage->getMenu();
echo $cPage->getClear();
echo $cPage->pageStringEnd();
echo $cPage->getFooter();
?> 
